var routes_module;

routes_module = angular.module('demo.route', []);

routes_module.config([
    '$stateProvider', '$urlRouterProvider',
    function($stateProvider, $urlRouterProvider) {
		$stateProvider
			.state('tab', {
				url: '/tab',
				abstract: true,
				templateUrl: 'templates/tabs.html'
			})

			//首页
			.state('tab.home', {
				url: '/home',
				views: {
				  'tab-home': {
				    templateUrl: 'templates/home/tab-home.html',
				    controller: 'homeCtrl'
				  }
				}
			})

			//demo1
			.state('tab.demo1', {
				url: '/demo1',
				views: {
				  	'tab-demo1': {
					    templateUrl: 'templates/demo1/tab-demo1.html',
					    controller: 'demo1Ctrl'
				  	}
				}
			})

			//demo2
			.state('tab.demo2', {
				url: '/demo2',
				views: {
					'tab-demo2': {
					  templateUrl: 'templates/demo2/tab-demo2.html',
					  controller: 'demo2Ctrl'
					}
				}
			})

			//demo2详情页
			.state('demo2_detail', {
				url: '/demo2_detail/:id',
				templateUrl: 'templates/demo2/demo2_detail.html',
				controller: 'demo2tDetailCtrl'
			})

			//我的
			.state('tab.my', {
				url: '/my',
				views: {
					'tab-my': {
						templateUrl: 'templates/my/tab-my.html',
						controller: 'myCtrl'
					}
				}
			});

			$urlRouterProvider.otherwise('/tab/home');

	}]);
